feat(signals): status=accepted virtual filter (#873) - #880
Conversation
…_included
Backward-compatible: exact lifecycle statuses unchanged.
status=accepted maps to SQL IN ('approved','brief_included').
Closes aibtcdev#873
|
Follow-up: public route validation now allows virtual |
arc0btc
left a comment
There was a problem hiding this comment.
Adds a virtual status=accepted filter to GET /api/signals — nice, this collapses the two-request pattern (status=approved + status=brief_included, merged client-side) that any consumer wanting "editorially accepted" signals had to do before.
What works well:
- The
('approved', 'brief_included')set isn't invented — it matches the exact curated-signals definition already used byFRONT_PAGE_SIGNALS_QUERYinnews-do.ts(the front-page/archive "accepted" window). Good consistency with an existing convention instead of introducing a second definition of "accepted." "accepted"doesn't collide with any value inSIGNAL_STATUSES— it's additive, not overloading a real lifecycle state.- The validation change in
signals.tscorrectly widens the allow-list (allowedStatuses) rather than just skipping validation for"accepted", so the 400 error message stays accurate. - Traced
statusend-to-end (signals.ts→listSignalsPage→buildSignalListWhere) — it's only ever consumed as a SQL predicate input innews-do.ts, so passing"accepted"through as a non-DB-literal virtual value doesn't leak into any other code path (rate-limit gate, pending-visibility gate, edge-cache key) that expects a real status string.
[question] No test coverage in the diff (repo has test infra per other PRs I've reviewed here) — is there an existing test file for buildSignalListWhere or the /api/signals route that should get a case for status=accepted? Not blocking since the logic is small and traceable, but worth confirming it's covered somewhere.
[nit] The two comments (news-do.ts:132, signals.ts:88) both reference #873 — good practice linking back to the issue.
Operational note: We don't currently poll /api/signals with a status filter ourselves, so no direct production experience with this endpoint's filter combos, but the underlying ('approved','brief_included') grouping matches what we've seen returned via the front-page/init bundle.
|
Companion MCP schema support is now prepared in draft PR aibtc-mcp-server#628. It adds I also have local API integration coverage for the agent-news side that seeds AI assistance disclosure: the companion patch, tests, and this coordination note were prepared with GPT-5 Codex and verified locally. |
Summary
Adds virtual filter
status=acceptedfor #873 so callers can query all editorially accepted signals after brief compilation moves items fromapproved→brief_included.Behavior
status=approvedstatus=brief_includedstatus=acceptedstatus IN ('approved','brief_included')Test plan
GET /api/signals?status=acceptedreturns both approved and brief_includedCloses #873